ScrollWindow

INHERITS FROM	Window : Responder : Object

WRITTEN BY	David S. Joerg, MindShock, Inc.

Version 1.0, Wed May 30 1990., This class is in the Public Domain. No guaranties are made to its usefulness or correctness.

CLASS DESCRIPTION

The Appkit provides facilities for automatically resizing Views.  However, for many Views it does not make sense to allow resizability (control panels, game boards, and palettes being good examples).  By using ScrollWindow for your fixed-size windows, users gain more control over how much screen space each window will take.  ScrollWindow is not very useful for resizable Views, since the user already has control over the window's size.

To use ScrollWindow, create a window as you normally would, either with the appropriate Appkit calls or in IB, but make the new window a ScrollWindow instead of Window.  When you are finished filling the ScrollWindow with Views, (or at appDidInit time if it's an IB window) call the ScrollWindow's becomeScrollWindow method, which will activate its ScrollWindow characteristics.

A ScrollWindow does not allow itself to be resized larger than the size of the View seen inside the scrollers (the contentView's docView).  When a ScrollWindow is resized at its largest size, the scrollers will disappear.  At smaller sizes, both the horizontal and vertical scrollers are present.

INSTANCE VARIABLES

Inherited from Object	Class	isa;

Inherited from Responder	id	nextResponder;

Inherited from Window	NXRect	frame; 	id	contentView; 	id	delegate; 	id	firstResponder; 	id	lastLeftHit; 	id	lastRightHit; 	id	counterpart; 	id	fieldEditor; 	int	winEventMask; 	int	windowNum; 	float	backgroundGray; 	struct _wFlags	wFlags; 	struct _wFlags2	wFlags2;

Declared in ScrollWindow	NXSize	minFrameSize;

METHOD TYPES

Setting up the ScrollWindow	- becomeScrollWindow

Setting Restraints on Resizing	- setMinFrameSize:

Overridden Delegate Methods	- windowWillResize:toSize:
		- windowDidResize:

INSTANCE METHODS

becomeScrollWindow

- becomeScrollWindow

This method should be called when you are done filling the ScrollWindow's contentView with Views.  You should only call this method once.  This method will move the current contentView down in the View heirarchy, placing a ScrollView above it as the new contentView.  After you've called this method, you should not touch the ScrollWindow's contentView, but only the ScrollWindow's contentView's docView.

setMinFrameSize:

- setMinFrameSize: (NXSize) newSize

Makes newSize the minimum frame size.  The minimum frame size is used in windowWillResize:toSize:.  You can call this method whenever you wish.

windowWillResize:toSize:

- windowWillResize: sender toSize:(NXSize *) frameSize

This method should not be called; it is called automatically during the user resizing process.  The ScrollWindow does not allow the window to be resized smaller than minFrameSize or larger than its contentView's docView.  This method does not pass the delegate message along.

windowDidResize:

- windowDidResize: sender

This method should not be called; it is called automatically after the user has picked a new size for the ScrollWindow.  If the new size is smaller than the maximum size, horizontal and vertical scrollers are activated; otherwise they are removed.  This method does not pass the delegate message along.